#include <stdio.h>

int missingNumber(int* nums, int numsSize) {

    int N = numsSize;
    int x = 0;
    for (int i = 0; i < N; ++i)
    {
        x ^= nums[i];
    }

    for (int j = 0; j <= N; ++j)
    {
        x ^= j;
    }
    return x;
}


int main()
{
	int nums[9] = { 0,1,2,3,4,5,6,7,9 };
    printf("%d", missingNumber(nums, 9));
	return 0;
}